package com.lbw.controller;


import com.lbw.entity.ScoreEntity;
import com.lbw.result.Result;
import com.lbw.result.ResultFactory;
import com.lbw.service.ScoreEntityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * <p>
 *  成绩控制类
 * </p>
 *
 * @author 周渝森
 * @since 2020-09-13
 */
@RestController
@RequestMapping("/scoreEntity")
@Api(tags = "成绩配置")
public class ScoreEntityController {

    @Autowired
    private ScoreEntityService scoreEntityService;

    /**
     * 展示分数列表
     * @param stuId 学生id
     */
    @PostMapping("/showScoreList")
    @ApiOperation("展示分数列表")
    public Result showScoreList(@ApiParam("学生id") @RequestParam("stuId") String stuId) {

        List<ScoreEntity> scoreEntityList = scoreEntityService.showScoreList(stuId);
        return ResultFactory.success(scoreEntityList);
    }

}

